from mztu import Mztu

url = "http://www.mzitu.com/xinggan/page/5/"
file_root = "F:/meizitu/xinggan/"

meizitu = Mztu()
print("------正在寻找找图集------")
url_list = meizitu.get_picture_url_list(url)
print(url_list)
index = 1
for page_url in url_list:
    print("------正在寻找找第" + index.__str__() + "个图集------")
    print("图片地址:"+page_url)
    page_info = meizitu.get_page_info(page_url)
    page_size = page_info[0]
    page_title = page_info[1]
    print("共找到" + page_size + "张图片")
    picture_url = meizitu.get_picture_url(page_url, page_size)
    print("正在下载第" + index.__str__() + "个图集")
    file_path = meizitu.get_file_path(file_root, page_size, page_title)
    meizitu.save_picture(picture_url, file_path)
    print("------第" + index.__str__() + "个图集下载完成------")
    index = index + 1
